package com.dataaccess.dataaccess.support.fluoriteCloud;

import cn.hutool.core.util.HexUtil;
import com.dataaccess.dataaccess.support.aibox.AmqpJavaClientDemo;
import com.dataaccess.dataaccess.support.coap.MyCoapServer;
import com.dataaccess.dataaccess.support.tcp.SiTerWell;
import com.dataaccess.dataaccess.support.udp.JB_QB_F52_UdpServer;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 继承Application接口后项目启动时会按照执行顺序执行run方法
 * 通过设置Order的value来指定执行的顺序
 */
@Component
@Order(value = 1)
public class StartService implements ApplicationRunner {
    @Resource
    ReadCommitMessagePatternMain readCommitMessagePatternMain;
    @Resource
    AsyncConsumerMessage asyncConsumerMessage;
    @Resource
    AmqpJavaClientDemo amqpJavaClientDemo;
    @Resource
    MyCoapServer myCoapServer;
    @Resource
    SiTerWell siTerWell;
    @Resource
    JB_QB_F52_UdpServer jb_qb_f52_udpServer;
    @Override
    public void run(ApplicationArguments args) throws Exception {
        //asyncConsumerMessage.useInit();
        amqpJavaClientDemo.msg();
        //siTerWell.server();
        //myCoapServer.getCoapServer();
        jb_qb_f52_udpServer.server();
    }

    public static void main(String[] args) {
        int aaa = Integer.parseInt("3c2f", 16);
        //System.out.println(aaa);3c2f352f303e2c3c2f32302f303e

        byte[] xxx = HexUtil.decodeHex("3c2f");
        String asa = new String(xxx);
//       System.out.println(new String(HexUtil.decodeHex("3c2f"))+new String(HexUtil.decodeHex("352f"))+new String(HexUtil.decodeHex("303e"))
////       +new String(HexUtil.decodeHex("2c3c"))+new String(HexUtil.decodeHex("2f32"))+new String(HexUtil.decodeHex("302f"))+new String(HexUtil.decodeHex("303e")));
        System.out.println(new String(HexUtil.decodeHex("4402")));
    }
}
